import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_page/info_data.dart';

/**
 *
 * @ProjectName:    manager_page
 * @ClassName:      base_adapter
 * @Description:    dart类作用描述
 * @Author:         孙浩
 * @QQ:             243280864
 * @CreateDate:     2020/11/25 12:30 AM
 */
class BaseAdapter extends StatelessWidget {

  InfoData _infoData;
  int index;

  BaseAdapter(this.index,this._infoData);

  @override
  Widget build(BuildContext context) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        ConstrainedBox(
          constraints: BoxConstraints(minWidth: 250),
          child: Text(
            (index == -1?"":"${index + 1}.")+"${_infoData.name}",
            style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
          ),
        ),
        SizedBox(
          width: 50,
        ),
        Expanded(
            child: Card(
                child: Padding(
                  child: Text("${_infoData.info}"),
                  padding: EdgeInsets.symmetric(horizontal: 50, vertical: 35),
                ),
                elevation: 5,
                shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(15))))
      ],
    );
  }
}
